package com.yjd.comm.asynmsg.model;

import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.yjd.comm.base.model.Model;
import com.yjd.comm.util.StringUtil;

public class TaskMsgModel extends Model {
	/**
	 * @Fields serialVersionUID
	 */
	private static final long serialVersionUID = 1L;
	/** 编号，自动增长，主键 **/
	private Long id;
	/** 消息类型 **/
	private String msg_type;
	/** 消息关联对象ID **/
	private String ref_id;
	/** 创建时间 **/
	private Long create_time;
	/** 处理时间 **/
	private Long dispose_time;
	/** 状态,0:待处理，1:处理完毕，默认为0 **/
	private Integer status;
	/** 最大发送失败次数 **/
	private Integer max_failure;
	/** 当前发送失败次数 **/
	private Integer failure;
	/**
	 * 客户id
	 */
	private String client_id;
	/**
	 * 客户订单id
	 */
	private String client_order_id;
	/** 扩展信息 **/
	private String extend_data;
	/**
	 * 计划处理时间
	 */
	private Long plan_ex_time;
	
	/**
	 * 计划处理时间
	 * @return
	 */
	public Long getPlan_ex_time() {
		return plan_ex_time;
	}

	public void setPlan_ex_time(Long plan_ex_time) {
		this.plan_ex_time = plan_ex_time;
	}

	public TaskMsgModel() {
	}

	public TaskMsgModel(String msg_type, String ref_id, Long create_time,
			Long dispose_time, Integer status, String extend_data,String client_id,String client_order_id) {
		this.msg_type = msg_type;
		this.ref_id = ref_id;
		this.create_time = create_time;
		this.dispose_time = dispose_time;
		this.status = status;
		this.extend_data = extend_data;
		this.client_id = client_id;
		this.client_order_id = client_order_id;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMsg_type() {
		return msg_type;
	}

	public void setMsg_type(String msg_type) {
		this.msg_type = msg_type;
	}

	public String getRef_id() {
		return ref_id;
	}

	public void setRef_id(String ref_id) {
		this.ref_id = ref_id;
	}

	public Long getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Long create_time) {
		this.create_time = create_time;
	}

	public Long getDispose_time() {
		return dispose_time;
	}

	public void setDispose_time(Long dispose_time) {
		this.dispose_time = dispose_time;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getMax_failure() {
		return max_failure;
	}

	public void setMax_failure(Integer max_failure) {
		this.max_failure = max_failure;
	}

	public Integer getFailure() {
		return failure;
	}

	public void setFailure(Integer failure) {
		this.failure = failure;
	}

	public String getExtend_data() {
		return extend_data;
	}

	public void setExtend_data(String extend_data) {
		this.extend_data = extend_data;
	}
	
	public String getClient_id() {
		return client_id;
	}

	public void setClient_id(String client_id) {
		this.client_id = client_id;
	}

	public String getClient_order_id() {
		return client_order_id;
	}

	public void setClient_order_id(String client_order_id) {
		this.client_order_id = client_order_id;
	}

	/**
	* 获取扩展数据信息
	* @return
	 */
	@SuppressWarnings("rawtypes")
	public Map getExtend_data_map(){
		if(StringUtil.isNotEmpty(this.getExtend_data())){
			return JSON.parseObject(this.getExtend_data());
		}
		return null;
	}

}
